package com.zzyl;

import com.huaweicloud.sdk.iotda.v5.IoTDAClient;
import com.huaweicloud.sdk.iotda.v5.model.*;
import com.zzyl.framework.config.IotClientConfig;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class testIOT {

    @Autowired
    private IotClientConfig iotClientConfig;

    @Test
        public void test(){
        IoTDAClient client = iotClientConfig.huaWeiIotInstance();
        ListProductsRequest listProductsRequest = new ListProductsRequest();
        listProductsRequest.setLimit(50);
        ListProductsResponse listDevicesResponse = client.listProducts(listProductsRequest);

        List<ProductSummary> products = listDevicesResponse.getProducts();
        System.out.println("看看产品列表："+ products);



    }

}
